<%-- 
    Document   : index
    Created on : Oct 27, 2011, 8:27:04 AM
    Author     : Arturia
--%>

<%@page import="DTO.SubjectDTO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="BLO.SubjectBLO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript">
    function setVisibility(username, loginfail){
        if(username == "null"){
            document.getElementById("person_info").style.visibility = "hidden";
            document.getElementById("login_form").style.visibility = "visible";
        }else{
            document.getElementById("person_info").style.visibility = "visible";
            document.getElementById("login_form").style.visibility = "hidden";
        }
    }
    function setError(loginfail){
        if(loginfail == null || loginfail == "false"){
            document.getElementById("loginerror").style.visibility = "hidden";
        }else{
            document.getElementById("loginerror").style.visibility = "visible";
        }
    }
</script>
<html>

    <head>
        <title>Student Management</title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
        <link rel="stylesheet" type="text/css" href="style/css/style.css" />
    </head>
    <%
                String username = (String) session.getAttribute("USERNAME");
                String loginfail = (String) session.getAttribute("LOGINFAIL");
    %>
    <body onload='setVisibility("<%=username%>"), setError("<%=loginfail%>")'>
        <div id="main">
            <div id="header">
                <div id="logo">
                    <div id="logo_text">
                        <!-- class="logo_colour", allows you to change the colour of the text -->
                        <h1><a href="index.jsp">Student<span class="logo_colour">Management</span></a></h1>
                        <h2>Simple. fast. effective. </h2>
                    </div>
                </div>
                <div id="menubar">
                    <ul id="menu">
                        <!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
                        <li id="person_info"><a href="Controller?Action=Logout"><%= username%> (Logout)</a></li>
                        <li class="selected"><a href="index.jsp">Home</a></li>
                        <li><a href="Education.jsp">Education</a></li>
          <li><a href="#">Library</a></li>
                        <li><a href="Contact.jsp">Contact Us</a></li>
                    </ul>
                </div>
            </div>
            <div id="content_header"></div>
            <div id="site_content">
                <div class="sidebar">
                    <!-- insert your sidebar items here -->
                    <h3>Resources</h3>
                    <ul id="list-nav">
                        <li><a href="Controller?Action=viewCourses">Courses</a></li>
                        <li><a href="mail.fpt.edu.vn">Mail</a></li>
                        <li><a href="http://cms-hcm.fpt.edu.vn/elearning/feedback">Feedback</a></li>
                        <li><a href="schedule.jsp">Schedule</a></li>
                        <li><a href="http://msdn70.e-academy.com/elms/Storefront/Home.aspx?campus=fptuniversity_it">MSDN AA</a></li>
                        <li><a href="http://cms-hcm.fpt.edu.vn/elearning/mod/resource/view.php?id=185">Change Password</a></li>
                    </ul>
                    <form method="POST" action="Controller" id="login_form">
                        <!-- Show khi ch&#432;a login vào h&#7879; th&#7889;ng -->
                        <h3>Login</h3>
                        Username:<input id="textbox" name="txtUsername" type="text" >
                        Password:<input id="textbox" name="txtPassword" type="password" >
                        <input name="Action" type="submit" value="Login">
                        <div id="loginerror" style="visibility: hidden">
                        <br>
                        <p style="color: red">Invalid username or password!</p>
                        </div>

                    </form>

                    <!-- Sau khi &#273;ã login vào h&#7879; th&#7889;ng, show nh&#7919;ng course c&#7911;a sinh viên ho&#7863;c giáo viên -->
                    <h3>All Courses</h3>
                    <ul>
                        <%
                                    SubjectBLO sblo = new SubjectBLO();
                                    ArrayList<SubjectDTO> subjectList = new ArrayList<SubjectDTO>();

                                    subjectList = sblo.getAllSubjects();
                                    request.setAttribute("SLIST", subjectList);
                        %>
                        <c:set var="list" value="${requestScope.SLIST}"></c:set>
                        <c:forEach items="${list}" var="subject">
                            <li><a href="#"><c:out value="${subject.strSubjectName}"/></a></li>
                        </c:forEach>
                    </ul>
                </div>
                <div id="content">
                    <br>
                    <h2>Evidence shows school selection at 11 does not work</h2>
                    <p>The conclusion that secondary school selection at the age of 11 is unwise is regarded as "messianic" and "an irrational prejudice" by Dr Christopher Ray, high master at Manchester grammar school (Letters, 24 October). He might ask himself a few questions. For example, why is the average A-level score of Hampshire, which does not select at 11, much higher than that of Kent, whose 32 grammar schools do? Given that some form of selection at 16 is necessary, do the students who do well at that age have to have been in any particular kind of school earlier? The answer is no. Schools, such as Westminster and Camden school for girls, with mixed sixth forms including students from other schools, do not find incoming students markedly inferior to those who entered at an earlier age. Nor do such students have to have been selected at 11. As at other sixth-form colleges, the students at Hills Road college were not so selected, and how do the results of that college compare with those of MGS in terms of Oxbridge entries? As for the "wilful misrepresent–ation" that "many independent schools like mine" are the "preserve of the rich", is he not aware that most of the highest-performing independent schools charge high fees? Academically, MGS used to compete on equal terms with Westminster, Winchester and Eton. If it still does and is educating considerable numbers of poor children, Dr Ray deserves congratulation. But does it?</p>

                    <br>
                    <h2>How to teach … children to cook</h2>
                    <p>The Guardian Teacher Network has some exclusive cooking resources from Jamie Oliver, developed as part of his campaign for healthy eating. Children can learn how to whip up a salad or breakfast and there is even a recipe for home-made mince. They can discover the difference between good and bad fats and find out all about pasta and dairy. Oliver gives tips on tricky basics such as how to separate an egg or – the stickiest culinary test – to prepare a mango without turning it into a mushy mess.</p>
                </div>
            </div>
            <div id="content_footer"></div>
            <div id="footer">
                <a href="index.jsp">Home</a> | <a href="#">News</a> | <a href="#">Education</a> | <a href="#">Library</a> | <a href="contact.html">Contact Us</a>
            </div>
        </div>
    </body>
</html>

